package com.huaruan.youdi.views;

import android.view.View;

public abstract class OnFastClickListener implements View.OnClickListener {
    private final static long MIN_CLICK_DELAY_TIME = 1000;
    long lastClickTime;

    @Override
    public void onClick(View v) {
        long currentClickTime = System.currentTimeMillis();
        if (currentClickTime - lastClickTime >= MIN_CLICK_DELAY_TIME) {
            lastClickTime = currentClickTime;
            onFastClick(v);
        }
    }

    public abstract void onFastClick(View v);
}
